package org.aphelie.chronicle.ui.forms;

import org.aphelie.chronicle.ArcTuple;
import org.aphelie.chronicle.ui.layout.ArcFormLayoutFactory;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.forms.widgets.TableWrapData;

public class ArcTupleSection extends ArcFormSection {
	
	private ArcTuple tuple;

	public ArcTupleSection(ArcTopicPage page, Composite parent, ArcTuple tuple, int style) {
		super(page, parent, style);
		this.tuple = tuple;
		createClient(getSection());
	}
	
	public ArcTupleSection(ArcFormSection section, ArcTuple tuple) {
		super(section);
		this.tuple = tuple;
	}
	
	public ArcTuple getTuple() {
		return tuple;
	}

	protected void createClient(Section section) {
		section.setText("ArcTupleSection");
		section.setLayout(ArcFormLayoutFactory.createClearTableWrapLayout(false, 2));
		TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
        section.setLayoutData(data);
        section.setDescription("ArcTupleSection.Description");
        
        Composite client = getToolkit().createComposite(section);
        client.setLayout(ArcFormLayoutFactory.createSectionClientTableWrapLayout(false, 3));
        section.setClient(client);
        
        /* for (EObject score : tuple.eContents()) {
        	
        }*/
	}
	
}
